﻿<Window x:Class="EpiNEXT.WPF.FormDesigner.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:EpiNEXT.WPF.FormDesigner"
        xmlns:pages="clr-namespace:EpiNEXT.WPF.FormDesigner.Pages"
        xmlns:controls="clr-namespace:EpiNEXT.WPF;assembly=EpiNEXT.WPF"
        xmlns:converters="clr-namespace:EpiNEXT.WPF.Converters;assembly=EpiNEXT.WPF"
        xmlns:p="clr-namespace:EpiNEXT.Core.Properties;assembly=EpiNEXT.Core"
        Title="Form Designer" Width="1024"
        Height="748">
    <Window.Resources>
        <converters:UppercaseConverter x:Key="UppercaseConverter" />
    </Window.Resources>
    <Window.DataContext>
        <controls:ProjectViewModel />
    </Window.DataContext>
    <Grid Background="{StaticResource WindowBackgroundBrush}">
        <pages:FormDesigner x:Name="formDesigner" Grid.Row="0" Grid.Column="0" Visibility="{Binding IsLoaded, Converter={StaticResource BooleanToVisibilityConverter}}"
                        />

        <Grid x:Name="grdIntro" Grid.Row="0" Grid.RowSpan="100" Grid.Column="0" Grid.ColumnSpan="100" 
              Background="{StaticResource WindowBackgroundBrush}" 
              Visibility="{Binding IsLoaded, Converter={StaticResource BooleanToCollapsedConverter}}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <Grid Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2">
                <TextBlock HorizontalAlignment="Left" Margin="140, 10, 20, 20" FontWeight="Bold" FontSize="24" Foreground="{StaticResource DarkTextBrush}" Text="{Binding Source={x:Static p:Settings.Default}, Path=ApplicationName, Mode=OneWay, Converter={StaticResource UppercaseConverter}}" />
            </Grid>

            <Grid x:Name="grdGettingStarted" Width="380" Grid.Column="0" Grid.Row="1">
                <Grid.Style>
                    <Style TargetType="{x:Type Grid}">
                        <Style.Triggers>
                            <Trigger Property="Visibility" Value="Visible">
                                <Trigger.EnterActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" DecelerationRatio="1" BeginTime="00:00:00" Duration="00:00:0.3">
                                                <SplineThicknessKeyFrame KeyTime="00:00:00" Value="20,0,-20,0" />
                                                <SplineThicknessKeyFrame KeyTime="00:00:0.3" Value="0,0,0,0" />
                                            </ThicknessAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.EnterActions>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Grid.Style>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <StackPanel Grid.Row="0">
                    <Label HorizontalAlignment="Left" Margin="30, 0, 20, 0" FontSize="16" FontWeight="Bold" Foreground="{StaticResource DarkTextBrush}">GETTING STARTED</Label>
                </StackPanel>
                <Grid Grid.Row="1" Margin="30, 6, 60, 20">
                    <Grid.Background>
                        <VisualBrush TileMode="Tile" Viewport="0,0,5,5" ViewportUnits="Absolute" Viewbox="0,0,5,5" ViewboxUnits="Absolute">
                            <VisualBrush.Visual>
                                <Canvas>
                                    <Rectangle Fill="White" Width="6" Height="6" />
                                    <!--<Path Stroke="#F0F0F0" Data="M 0 0 l 10 10" />-->
                                </Canvas>
                            </VisualBrush.Visual>
                        </VisualBrush>
                    </Grid.Background>
                    <Rectangle Fill="{StaticResource DarkTextBrush}" Height="5" VerticalAlignment="Top"></Rectangle>
                    <StackPanel Margin="10">
                        <TextBlock Margin="15" Foreground="{StaticResource DarkTextBrush}" VerticalAlignment="Top" TextWrapping="Wrap" FontSize="20" Text="Select an EpiNEXT project from the list to the right, or browse to find other data sources." />
                        <StackPanel Height="10" />
                        <!--<TextBlock VerticalAlignment="Top" TextWrapping="Wrap" FontSize="14" Text="2" />
                        <StackPanel Height="10" />-->
                        <StackPanel Height="1" Background="{StaticResource DarkTextBrush}" />
                        <StackPanel Height="10" />
                        <Grid HorizontalAlignment="Left" Background="Transparent" >
                            <Grid.Style>
                                <Style TargetType="{x:Type Grid}">
                                    <Style.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter Property="Background">
                                                <Setter.Value>
                                                    <SolidColorBrush Opacity="0.5" Color="Silver" />
                                                </Setter.Value>
                                            </Setter>
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>
                            </Grid.Style>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="46" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <!--<Path Grid.Column="0" Width="22" Height="22" Stretch="Fill" Fill="{StaticResource AccentBrush}" Data="F1 M 35,19L 41,19L 41,35L 57,35L 57,41L 41,41L 41,57L 35,57L 35,41L 19,41L 19,35L 35,35L 35,19 Z "/>-->
                            <Path Width="22" Height="22" Stretch="Fill" Fill="{StaticResource AccentBrush}" Data="F1 M 21,30.0001L 55.9999,30.0001L 55.9999,50L 21,50L 21,30.0001 Z M 52,28L 37,28C 38,25 39.4999,24.0001 39.4999,24.0001L 50.75,24C 51.3023,24 52,24.6977 52,25.25L 52,28 Z M 53.5,52C 54.8807,52 56,53.1193 56,54.5C 56,55.8807 54.8807,57 53.5,57C 52.1193,57 51,55.8807 51,54.5C 51,53.1193 52.1193,52 53.5,52 Z M 46.5,52C 47.8807,52 49,53.1193 49,54.5C 49,55.8807 47.8807,57 46.5,57C 45.1193,57 44,55.8807 44,54.5C 44,53.1193 45.1193,52 46.5,52 Z M 39.5,52C 40.8807,52 42,53.1193 42,54.5C 42,55.8807 40.8807,57 39.5,57C 38.1193,57 37,55.8807 37,54.5C 37,53.1193 38.1193,52 39.5,52 Z "/>
                            <Path Grid.Column="0" x:Name="Base_Circle" Width="38" Height="38" Stretch="Fill" Fill="{StaticResource AccentBrush}" Data="F1 M 38,0.791664C 58.5496,0.791664 75.2083,17.4504 75.2083,38C 75.2083,58.5496 58.5496,75.2083 38,75.2083C 17.4504,75.2083 0.791662,58.5496 0.791662,38C 0.791662,17.4504 17.4504,0.791664 38,0.791664 Z M 38,5.54166C 20.0738,5.54166 5.54167,20.0738 5.54167,38C 5.54167,55.9262 20.0738,70.4583 38,70.4583C 55.9262,70.4583 70.4583,55.9262 70.4583,38C 70.4583,20.0738 55.9262,5.54166 38,5.54166 Z "/>

                            <TextBlock Foreground="{StaticResource DarkTextBrush}" Grid.Column="1" VerticalAlignment="Center" FontSize="16" FontWeight="Bold" Margin="10, 0, 0, 2" Text="Browse" />
                        </Grid>

                        <!--<Path Fill="#9A1D20" Data="" />-->
                    </StackPanel>
                </Grid>
            </Grid>

            <Grid Grid.Column="1" Grid.Row="1" ClipToBounds="False">
                <pages:Home x:Name="pageHome" ProjectOpened="Home_ProjectOpened" ClipToBounds="False" />
                <pages:Forms x:Name="pageForms" FormOpened="Forms_FormOpened" BackButtonClicked="Forms_BackButtonClicked" Visibility="Collapsed" />
            </Grid>
        </Grid>

        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.RowSpan="100" Grid.ColumnSpan="100"
              Background="{StaticResource WindowBackgroundBrush}"
            Visibility="{Binding IsLoadingProject, Converter={StaticResource BooleanToVisibilityConverter}}">
            <Border BorderBrush="{StaticResource WindowBorderBrush}" BorderThickness="1" Background="White"
                    HorizontalAlignment="Center" VerticalAlignment="Center"
                    >
                <Grid x:Name="grdLoading" Grid.Row="0" Grid.RowSpan="100" Grid.Column="0" Grid.ColumnSpan="100" 
                  HorizontalAlignment="Center" VerticalAlignment="Center">
                    <StackPanel Margin="20">
                        <TextBlock Style="{StaticResource Heading1}" HorizontalAlignment="Center">Loading...</TextBlock>
                        <StackPanel Height="10" />
                        <ProgressBar IsIndeterminate="True" Width="400" Height="20" Margin="20" />
                    </StackPanel>
                </Grid>
            </Border>
        </Grid>

        
    </Grid>
</Window>